﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using WindowsLive.Writer.Api;

namespace wlwthumb
{
    //[WriterPlugin("D2E850DB-E9B3-4073-854D-54BAB0BC44DC",
    //"ZosoThumb2",
    //Description = "ZosoThumb2",
    //HasEditableOptions = true,
    //Name = "ZosoThumb2",
    //    //    ImagePath = "Polaroid.ico",
    //PublisherUrl = "http://www.codres.de")]
    //[InsertableContentSource("ZosoThumb2")] 
    public class WLWThumb2:SmartContentSource    
    {
        private string htmlCode;
        public override void EditOptions(System.Windows.Forms.IWin32Window dialogOwner)
        {
            WLWThumb.ShowSettings(dialogOwner, Options);
        }

        public override System.Windows.Forms.DialogResult CreateContent(System.Windows.Forms.IWin32Window dialogOwner, ISmartContent newContent)
        {
            string c = "";
            WLWThumb.GetThumbnailCode(Options, ref c);

            this.htmlCode = c;

            return System.Windows.Forms.DialogResult.OK;
        }
        public override SmartContentEditor CreateEditor(ISmartContentEditorSite editorSite)
        {

            SmartContentEditor ed = new SmartContentEditor();            
            ed.Show();

            return ed;
        }

        public override string GeneratePublishHtml(ISmartContent content, IPublishingContext publishingContext)
        {
            return this.htmlCode;
        }
    }
}
